package c.b.a.b.n;

import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.widget.FrameLayout;

public class b {

    /* renamed from: a  reason: collision with root package name */
    public static final boolean f1901a = (Build.VERSION.SDK_INT < 18);

    public static void a(a aVar, View view, FrameLayout frameLayout) {
        c(aVar, view, frameLayout);
        if (f1901a) {
            frameLayout.setForeground(aVar);
        } else {
            view.getOverlay().add(aVar);
        }
    }

    public static void b(a aVar, View view, FrameLayout frameLayout) {
        if (aVar != null) {
            if (f1901a) {
                frameLayout.setForeground((Drawable) null);
            } else {
                view.getOverlay().remove(aVar);
            }
        }
    }

    public static void c(a aVar, View view, FrameLayout frameLayout) {
        Rect rect = new Rect();
        (f1901a ? frameLayout : view).getDrawingRect(rect);
        aVar.setBounds(rect);
        aVar.t(view, frameLayout);
    }

    public static void d(Rect rect, float f, float f2, float f3, float f4) {
        rect.set((int) (f - f3), (int) (f2 - f4), (int) (f + f3), (int) (f2 + f4));
    }
}
